import { getshopCartList } from '@/api/index'
const state = {
  cartlist: [
    {cartInfoList:[]}
  ],
}
const mutations = {
  GETSHOPCARTLIST(state, cartlist) {
    state.cartlist = cartlist
  },
}
const actions = {
  async getShopCartList({ commit }) {
    let result = await getshopCartList()
    if (result.code == 200) {
      commit('GETSHOPCARTLIST', result.data)
    }
  },
}
const getters = {
  cartList(state) {
    
    return state.cartlist[0]
  },
}
export default {
  state,
  mutations,
  actions,
  getters,
}
